home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / utility / uwserver.zip / uwserver.tar / h / uwlib.h < prev   
C/C++ Source or Header  |  1991-01-25  |  2KB  |  71 lines

  1. /*
  2.  *    uw library definitions
  3.  *
  4.  * Copyright 1986 by John D. Bruner.  All rights reserved.  Permission to
  5.  * copy this program is given provided that the copy is not sold and that
  6.  * this copyright notice is included.
  7.  */
  8.  
  9. #include "uw_err.h"
  10. #include "uw_ipc.h"
  11.  
  12. #ifndef NBBY
  13. #define    NBBY        8        /* defined in <sys/types.h> in 4.3BSD */
  14. #endif
  15.  
  16. #define    UW_NUMOPTS    32        /* number of window options */
  17. #define    UW_NWTYPES    6        /* number of window emulation types */
  18.  
  19. typedef char uwtitle_t[256];
  20.  
  21. struct uwpoint {
  22.     unsigned    uwp_v;        /* vertical component */
  23.     unsigned    uwp_h;        /* horizontal component */
  24. };
  25.  
  26. struct uw_info {
  27.     uwid_t        uwi_id;        /* unique window ID */
  28.     int        uwi_datafd;    /* file descriptor for data */
  29.     int        uwi_ctlfd;    /* file descriptor for control */
  30.     uwerr_t        uwi_uwerr;    /* last error from UW */
  31.     int        uwi_errno;    /* last error from system call */
  32.     int        uwi_vis;    /* visiblility */
  33.     uwtype_t    uwi_type;    /* window type */
  34.     struct uwpoint    uwi_pos;    /* window position (in pixels) */
  35.     uwtitle_t    uwi_title;    /* window title */
  36.     struct uwpoint    uwi_wsize;    /* window size (in pixels) */
  37.     struct {
  38.         void    (*uwi_optfn)();    /* option handler */
  39.     }        uwi_options[UW_NUMOPTS];
  40.     int        uwi_ipclen;    /* length of data in IPC buffer */
  41.     struct uwipc    uwi_ipcbuf;    /* buffer for IPC messages */
  42. };
  43.  
  44. #define    UW_DATAFD(uwin)        (uwin)->uwi_datafd
  45. #define    UW_ID(uwin)        (uwin)->uwi_id
  46. #define    UW_PERROR(uwin, mesg)    \
  47.     uw_perror(mesg, (uwin)->uwi_uwerr, (uwin)->uwi_errno)
  48.  
  49. typedef struct uw_info *UWIN;
  50. typedef void (*uwfnptr_t)();
  51.  
  52. extern uwid_t uw_cmd();
  53. extern UWIN uw_new();
  54. extern uw_close(), uw_detach();
  55. extern uw_optcmd();
  56. extern uw_kill();
  57. extern uwfnptr_t uw_optfn();
  58. extern uw_rsetopt();
  59. extern void uw_perror();
  60. extern uwid_t uw_fork(), uw_cmd(), uw_shell();
  61.  
  62. extern uw_gvis(), uw_svis();
  63. extern uw_gtype(), uw_stype();
  64. extern uw_gtitle(), uw_stitle();
  65. extern uw_gwsize(), uw_swsize();
  66. extern uw_gpos(), uw_spos();
  67.  
  68. extern uwerr_t uwerrno;
  69. extern char *uwerrlist[];
  70. extern unsigned uwnerr;
  71.